locals {

  tenant      = "xiaoqi"
  ebike_count = 1000
  domain = "starmove.com"

  // White Group
  default_group = ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
  dms_group = ["0.0.0.0/0"]

  // MySQL
  rds_accounts = [
    {
      name         = "user1"
      password     = "1234abc"
      type         = "Normal"
      privilege    = "ReadWrite"
      databases    = ["dbuserv1", "dbuserv2", "pipeline"]
    },
    {
      name         = "user2"
      password     = "1234abc"
      type         = "Normal"
      privilege    = "ReadWrite"
      databases    = ["dbuserv1"]
    }
  ]

  databases = [
    {
      name          = "dbuserv1"
      character_set = "utf8"
      description   = "db1"
    },
    {
      name          = "dbuserv2"
      character_set = "utf8"
      description   = "db2"
    },
    {
      name          = "pipeline"
      character_set = "utf8"
      description   = "pipeline"
    }
  ]

  rds_parameters = [
    {
      name = "sql_mode"
      value = ""
    },
    {
      name = "slow_query_log"
      value = "OFF"
    }
  ]

  // Redis
  redis_accounts = [
    {
      name         = "user1"
      password     = "Test12345"
      privilege = "RoleReadWrite"
      description  = "desp1"
    },
    {
      name         = "user2"
      password     = "Test12345"
      privilege    = "RoleReadOnly"
      description  = "deps2"
    },
    {
      name         = "user3"
      password     = "Test12345"
      privilege    = "RoleRepl"
      description  = "deps3"
    }
  ]

  redis_config = {
    maxmemory-policy       = "volatile-ttl",
    appendonly             = "no",
    notify-keyspace-events = "Ex"
  }

  // DNS
  sub_domains  = ["business", "client", "paas", "scheduler"]

  // K8S
  k8s_name     = local.tenant
  log_project_name = "log-for-${local.tenant}"

  tags = {
    app         = "ebike"
    tenant      = local.tenant
    env         = "prod"
    create_by   = "xiaoan"
  }

}